﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PServiceBus.Core.Interface {
    public interface IObjectProvider<TObject> : IEnumerable<TObject>, IDisposable 
        where TObject : class {
        Func<TObject, Guid> IDFunc { get; set; }
        bool Add(IEnumerable<TObject> list);
        bool Add(TObject obj);
        bool Refresh(TObject obj);
        void Clear();
        void Delete();
        bool Delete(TObject obj);
        bool Delete(IEnumerable<TObject> list);
        bool Delete(IEnumerable<Func<TObject, bool>> conditions);
        bool Delete(Func<TObject, bool> condition);
        bool Exists(Func<TObject, bool> condition);
        TObject Get(Func<TObject, bool> condition);
        bool Exists(TObject obj);
        TObject Get(Guid id);
        string Endpoint { get; set; }
        string EndpointAlias { get; set; }
        bool AppendTypeNameToEndpoint { get; set; }
        bool DeleteObjectOnRead { get; set; }
    }
}
